/**
 * 功能描述: 基础下拉菜单项样式表
 * @author 崔孝楠
 * @date 2022/9/23 15:33
 * @version 1.0
 */
@import '../../style/index';

// 下拉菜单项图标布局
@mixin dropdown-menu-item-icon--layout {
  min-width: 12px;
  margin-right: 8px;
}

// 下拉菜单项布局
@mixin dropdown-menu-item--layout {
  position: relative;
  display: flex;
  align-items: center;
  clear: both;
  margin: 0;
  padding: 5px 12px;
  line-height: 22px;
}

// 分割线布局
@mixin dropdown-menu-item-divider--layout {
  height: 1px;
  margin: 4px 0;
  overflow: hidden;
  line-height: 0;
}

// 下拉菜单项样式
@include b(dropdown-menu-item) {
  color: $color-text-primary;
  font-weight: normal;
  font-size: $font-size-base;
  cursor: pointer;
  transition: all 0.3s;
  @include dropdown-menu-item--layout;
  // 悬浮样式
  &:hover {
    background-color: $background-color-base;
  }
}
// 下拉菜单禁用样式
@include b(dropdown-menu-item-disabled) {
  color: $font-color-disabled-base;
  cursor: not-allowed;
  // 悬浮样式
  &:hover {
    color: $font-color-disabled-base;
    background-color: $color-white;
    cursor: not-allowed;
  }
  // a标签
  a {
    pointer-events: none;
  }
}
// 下拉菜单项图标样式
@include b(dropdown-menu-item-icon) {
  font-size: $font-size-extra-small;
  @include dropdown-menu-item-icon--layout;
}
// 菜单项内容布局
@include b(dropdown-menu-title-content) {
  flex: auto;
  white-space: nowrap;
  // a标签后置子元素
  > a::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    content: '';
  }
}
// 菜单项内a标签样式
@include b(dropdown-menu-title-content) {
  > a {
    color: inherit;
    transition: all 0.3s;
    // 悬浮样式
    &:hover {
      color: inherit;
    }
  }
}
// 分割线样式
@include b(dropdown-menu-item-divider) {
  background-color: #f0f0f0;
  @include dropdown-menu-item-divider--layout;
}

